/**
 * 
 */
package com.mycompany.client.dataset;

import com.mycompany.shared.EnvConstants;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.fields.DataSourceTextField;

/**
 * @author coral.ma
 *
 */
public class SideNavGridDS extends DataSource {

	public static SideNavGridDS instance = null;
	
    public static SideNavGridDS getInstance() {  
        if (instance == null) {  
            instance = new SideNavGridDS("sideNavGridDS");  
        }  
        return instance;  
    }
    
    public SideNavGridDS(String id) {
    	setID(id);
    	setRecordXPath("/List/navigation");  
        DataSourceTextField navigationField = new DataSourceTextField("node", "Controller",EnvConstants.SIDE_NAVIGATION_BAR_LENGTH);
        navigationField.setRequired(true);
        navigationField.setPrimaryKey(true);
        
        DataSourceTextField categoryField = new DataSourceTextField("category", "",0);
        categoryField.setHidden(true);
        
        DataSourceTextField pageField = new DataSourceTextField("page", "",0);
        pageField.setHidden(true);
        setFields(navigationField,categoryField, pageField);
        setDataURL("ds/data/navigation.data.xml");  
        setClientOnly(true);  
    }
}
